
	function setIntervalMethod(fun, timeSpan) {
		setInterval(fun, timeSpan);
	};
	let searchDiv = document.getElementById("searchDiv01");
	function activeLunBo01(objFather, obj, objChildren, timeSpan = 3000) {
		obj.button01 = objFather.getElementsByClassName("prevLi")[0];
		obj.button02 = objFather.getElementsByClassName("nextLi")[0];
		obj.ulLiOrder01 = 0;
		obj.iii = 0;
		obj.flag01 = false;
		obj.flag02 = true; // 用于setInterval函数的启动开锁
		obj.set = null;
		clearInterval(obj.set);
		obj.set = setInterval(function() {
			obj.flag02 && obj.button01.click();
			showHide();
		}, timeSpan);
		obj.button01.addEventListener("click", function() {
			if(obj.flag01 === true) {
				obj.ulLiOrder01--;

			} else {
				obj.ulLiOrder01++;

			}

			obj.style.left = ((-obj.offsetWidth / 2) * obj.ulLiOrder01) + "px";
			if(obj.ulLiOrder01 === 1) {
				obj.flag01 = true;

			} else if(obj.ulLiOrder01 === 0) {
				obj.flag01 = false;

			}

		});
		obj.button02.addEventListener("click", function() {

			if(obj.flag01 === true) {
				obj.ulLiOrder01--;

			} else {
				obj.ulLiOrder01++;

			}

			obj.style.left = ((-obj.offsetWidth / 2) * obj.ulLiOrder01) + "px";
			if(obj.ulLiOrder01 === 1) {
				obj.flag01 = true;

			} else if(obj.ulLiOrder01 === 0) {
				obj.flag01 = false;

			}
		});
		objFather.addEventListener("mouseenter", function() {
			obj.flag02 = false;
			//obj.set = null;
			objFather.addEventListener("mouseleave", function() {
				obj.flag02 = true;

			});
		});
		// 当window重新调整宽度时,让这个轮播图ul列表的left变为0,回到left的起始位置
		window.onresize = function() {
			obj.style.left = ((-obj.offsetWidth / 2) * obj.ulLiOrder01) + "px";
			console.log(obj.style.left);
		}
		
		// 手指触摸移动轮播图，可让盒子根据手指划动方向进行移动的函数
		function touchInvokeMoveDiv() {
			obj.move1 = 0;
			obj.move2 = 0;
			objFather.addEventListener("touchstart", function(e1) {
				console.log(111);
				obj.move1 = e1.touches[0].pageX;
				objFather.addEventListener("touchmove", function(e3) {
				
					obj.move2 = e3.touches[0].pageX;
					//console.log(obj.move2);
					obj.move2 = parseInt(obj.move1 - obj.move2);
					// 手指往右划动列表，列表在临界条件之前可以向左进行一定距离移动
					if(obj.move2 > 50 && obj.ulLiOrder01 <= 0) {
						console.log(222);
						obj.style.left = (obj.offsetLeft - obj.move2) + "px";
						obj.style.left = (obj.offsetLeft <= (obj.offsetWidth / 2)) ? ((obj.offsetLeft - obj.move2) + "px") : "0px";
					}
					// 手指往右划动列表，列表在临界条件之前可以 向右进行一定距离移动
					else if(obj.move2 < -50 && obj.ulLiOrder01 > 0) {
						console.log(333);
						obj.style.left = obj.offsetLeft >= 0 ? "0px" : ((obj.offsetLeft - obj.move2) + "px");
					}
				});
			});
			
		}
		touchInvokeMoveDiv();
		// 我们没有一直待在这个页面，当切换到其他页面时，停止这个页面的定时器
		function showHide() {
			if(document.hidden) {
				obj.flag02 = false;
			}
			else {
				obj.flag02 = true;
			}
		}
		
	};
	let carouselDiv1 = document.getElementById("carousel-div1");
	let carouselDiv1Ul = carouselDiv1.getElementsByTagName("ul")[0];
	let carouselDiv1UlLi = carouselDiv1Ul.children;
	// 开始调用轮播图函数
	activeLunBo01(carouselDiv1, carouselDiv1Ul, carouselDiv1UlLi, 5000);
	